package com.lagou.edu.dao;

import com.lagou.edu.pojo.LagouAutoCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface CodeDao extends JpaRepository<LagouAutoCode,Integer> {

    @Query(value = "select * from lagou_auth_code where email = ?1 order by createtime desc limit 1", nativeQuery = true)
    LagouAutoCode selectCodeByEmail(String email);
}
